from . import web
from app.models.gift import Gift
from app.view_models.book import BookViewModel
from flask import render_template, request,redirect,url_for, flash

__author__ = '七月'


@web.route('/')
def index():
    recent_gifts= Gift.recent()
    print(recent_gifts)
    books= [BookViewModel(gift.book) for gift in recent_gifts]
    # for gift in recent_gifts:
    #     print(gift.book)
    return render_template("index.html",recent =books)

@web.route('/personal')
def personal_center():
    pass
